package com.atguigu.day20.syn01.s2;

//todo 翠花线程
public class ChThread extends Thread {

    Account account;

    @Override
    public void run() {
        //1.余额校验
        if (account.money >= 1500) {
            //2.满足 取钱成功
            account.withDraw(1500);
            System.out.println(this.getName() + " 取钱成功,余额是" + account.money + "元");
        } else {
            //3.不满足 取钱失败
            System.out.println(this.getName() + " 取钱失败 余额不足,余额是" + account.money + "元");
        }

    }
}
